package com.icloud.auth.remote;

import com.icloud.api.vo.authority.PermissionInfo;
import com.icloud.api.vo.user.UserInfo;
import com.icloud.auth.core.configuration.FeignConfiguration;
import com.icloud.common.InvokeResult;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.jws.soap.SOAPBinding;
import java.util.List;


/**
 * 用户服务
 *
 * @author cuiyl
 */
@FeignClient(value = "icloud-admin",  fallback=UserServiceFallback.class, configuration = FeignConfiguration.class)
public interface IUserService {
    @RequestMapping(value = "/api/user/username/{username}", method = RequestMethod.GET)
    public InvokeResult<UserInfo> getUserByUsername(@PathVariable("username") String username);

    @RequestMapping(value = "/api/user/un/{username}/permissions", method = RequestMethod.GET)
    public InvokeResult<List<PermissionInfo>> getPermissionByUsername(@PathVariable("username") String username);

    @RequestMapping(value = "/api/permissions", method = RequestMethod.GET)
    InvokeResult<List<PermissionInfo>> getAllPermissionInfo();
}
